<?php 
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header', 'admin');
?>
<div class="pad-lr-10">
<form name="myform" action="?m=courses&c=admin_courses&a=listorder" method="post">
<div class="table-list">
    <table width="100%" cellspacing="0">
        <thead>
            <tr>
			<th width="68" align="center"><?php echo L('classes_name')?></th>
			<th width="80" align="center"><?php echo L('courses_name')?></th>
			<th width='120' align="center"><?php echo L('coursestime_time')?></th>
			<th align="center"><?php echo L('coursestime_note')?></th>
			<th width="50" align="center"><?php echo L('is_used')?></th>
			<th width="60" align="center">学生绑定数</th>
			<th width="60" align="center">教师绑定数</th>
			<th width="80" align="center"><?php echo L('operations_manage')?></th>
            </tr>
        </thead>
    <tbody>
 <?php 
if(is_array($data)){
	foreach($data as $coursestime){
?>   
	<tr>
	<td align="center"><?php echo $coursestime['cid']?></td>
	<td align="center"><?php echo $coursestime['csid']?></td>
	<td align="center"><?php echo $coursestime['ctime']?></td>
	<td align="center"><?php echo $coursestime['cnote']?></td>
	<td align="center"><?php echo $coursestime['ctused']?></td>
	<td align="center"><?php echo $coursestime['student_join_nums']?></td>
	<td align="center"><?php echo $coursestime['teacher_join_nums']?></td>
	<td align="center">&nbsp;
	<?php if ($coursestime['unedit']){?>
	<a href="javascript:edit('<?php echo $coursestime['ctid']?>', '<?php echo $coursestime['csid']?>');void(0);"><?php echo L('edit')?></a> | 
	<?php }?>
	  <a href='?m=courses&c=admin_courses&a=delete&ctid=<?php echo $coursestime['ctid']?>'
			onClick="return confirm('删除该课程将导致会员绑定课时被强制删除，您确定继续吗？')"><?php echo L('delete')?></a>
	</td>
	</tr>
<?php 
	}
}
?>
</tbody>
    </table>
  
</div>
 <div id="pages"><?php echo $this->db->pages;?></div>
</form>
</div>
</body>
</html>
<script type="text/javascript">
function edit(id, title) {
	window.top.art.dialog({id:'edit'}).close();
	window.top.art.dialog({title:'<?php echo L('coursestime_edit')?>--'+title, id:'edit', iframe:'?m=courses&c=admin_courses&a=edit&ctid='+id ,width:'700px',height:'400px'}, function(){var d = window.top.art.dialog({id:'edit'}).data.iframe;
	var form = d.document.getElementById('dosubmit');form.click();return false;}, function(){window.top.art.dialog({id:'edit'}).close()});
}
</script>